﻿abstract class Weapon
{
    public abstract double Price { get; set; }
    public abstract double Weight { get; set; }
    public abstract string Name { get; set; }
}

class Firearm : Weapon
{
    public double Bullets_quantity;
    public double Bullets_caliber;
    public double Effective_range;

    public double _price;
    public double _weight;
    public string _name;

    public override string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    public override double Price
    {
        get { return _price; }
        set { _price = value; }
    }

    public override double Weight
    {
        get { return _weight; }
        set { _weight = value; }
    }
}

class ColdsteelWeapon : Weapon
{
    public double Blade_length;

    public double _price;
    public double _weight;
    public string _name;

    public override string Name
    {
        get { return _name; }
        set { _name = value; }
    }

    public override double Price
    {
        get { return _price; }
        set { _price = value; }
    }

    public override double Weight
    {
        get { return _weight; }
        set { _weight = value; }
    }
}


class Handgun : Firearm
{
    public Handgun() : this(null) { }
    public Handgun(string _name) : this(_name, 0) { }
    public Handgun(string _name, double _price) : this(_name, _price, 0) { }
    public Handgun(string _name, double _price, double _weight)
    {
        this._name = _name;
        this._price = _price;
        this._weight = _weight;
    }
    public Handgun(string _name, double _price, double _weight, double Bullets_quantity, double Bullets_caliber, double Effective_range)
    {
        this._name = _name;
        this._price = _price;
        this._weight = _weight;
        this.Bullets_quantity = Bullets_quantity;
        this.Bullets_caliber = Bullets_caliber;
        this.Effective_range = Effective_range;
    }
}

class Bayonet : ColdsteelWeapon
{
    public Bayonet() : this(null) { }
    public Bayonet(string _name) : this(_name, 0) { }
    public Bayonet(string _name, double _price) : this(_name, _price, 0) { }
    public Bayonet(string _name, double _price, double _weight)
    {
        this._name = _name;
        this._price = _price;
        this._weight = _weight;
    }
    public Bayonet(string _name, double _price, double _weight, double Blade_length)
    {
        this._name = _name;
        this._price = _price;
        this._weight = _weight;
        this.Blade_length = Blade_length;
    }
}
abstract class FirearmCreator
{
    public abstract Firearm FactoryMethod();
    public abstract Firearm FactoryMethod(string _name);
    public abstract Firearm FactoryMethod(string _name, double _price);
    public abstract Firearm FactoryMethod(string _name, double _price, double _weight);
    public abstract Firearm FactoryMethod(string _name, double _price, double _weight, double Bullets_quantity, double Bullets_caliber, double Effective_range);
}

abstract class ColdsteelWeaponCreator
{
    public abstract ColdsteelWeapon FactoryMethod();
    public abstract ColdsteelWeapon FactoryMethod(string _name);
    public abstract ColdsteelWeapon FactoryMethod(string _name, double _price);
    public abstract ColdsteelWeapon FactoryMethod(string _name, double _price, double _weight);
    public abstract ColdsteelWeapon FactoryMethod(string _name, double _price, double _weight, double Blade_length);
}

class HandgunCreator : FirearmCreator
{
    public override Firearm FactoryMethod()
    {
        return new Handgun();
    }

    public override Firearm FactoryMethod(string _name)
    {
        return new Handgun(_name);
    }

    public override Firearm FactoryMethod(string _name, double _price)
    {
        return new Handgun(_name, _price);
    }

    public override Firearm FactoryMethod(string _name, double _price, double _weight)
    {
        return new Handgun(_name, _price, _weight);
    }
    public override Firearm FactoryMethod(string _name, double _price, double _weight, double Bullets_quantity, double Bullets_caliber, double Effective_range)
    {
        return new Handgun(_name, _price, _weight, Bullets_quantity, Bullets_caliber, Effective_range);
    }
}

class BayonetCreator : ColdsteelWeaponCreator
{
    public override ColdsteelWeapon FactoryMethod()
    {
        return new Bayonet();
    }

    public override ColdsteelWeapon FactoryMethod(string _name)
    {
        return new Bayonet(_name);
    }

    public override ColdsteelWeapon FactoryMethod(string _name, double _price)
    {
        return new Bayonet(_name, _price);
    }

    public override ColdsteelWeapon FactoryMethod(string _name, double _price, double _weight)
    {
        return new Bayonet(_name, _price, _weight);
    }
    public override ColdsteelWeapon FactoryMethod(string _name, double _price, double _weight, double Blade_length)
    {
        return new Bayonet(_name, _price, _weight, Blade_length);
    }
}
class Division
{
    public double weight;
    public double cost;
    public double quantity_units;
    public Firearm Main_weapon;
    public ColdsteelWeapon Main_coldsteel;

    public double Cost()
    {
        cost = Main_weapon._price * quantity_units + Main_coldsteel._price * quantity_units;
        return cost;
    }

    public double Weight()
    {
        weight = Main_weapon._weight * quantity_units + Main_coldsteel._weight * quantity_units;
        return weight;
    }
}
